import request from '@/utils/request'
import qs from 'qs'
import ServerResponseCode from '@/utils/ServerResponseCode';
// 请求地址前缀
const REQUEST_URL_PRE = "/manage/merchantCollectMoneyCode";
// 上传地址
export const UPLOAD_IMG_URL = ServerResponseCode.PROJECT_SERVER_PRE + REQUEST_URL_PRE + "/upload";

/**
 * 获取商户下的收款账户对应的收款码集合
 * @param {String} account 
 */
export function fetchList(account) {
    let data = { "account": account };
    //let requestData = qs.stringify(data);
    return request({
        url: REQUEST_URL_PRE + '/list',
        method: 'get',
        params: data
    })
}

/**
 * 删除商户下的收款码数据
 * @param {int} id -- 收款码数据id
 */
export function deleteById(id) {
    let data = { "id": id };
    let requestData = qs.stringify(data);
    return request({
        url: REQUEST_URL_PRE + '/delete',
        method: 'post',
        data: requestData
    })
}
